<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        .box{margin:10px;padding:10px;border:solid 1px black;}
        .box1{width:300px;height:300px;background: red;}
        .box2{width:200px;height:200px;background: green;}
        .box3{width:100px;height:100px;background: blue;}
    </style>
</head>
<body>
    <div class="app">
        <div class="box1 box" @click="fn1">
            <div class="box2" @click.stop="fn2">
                <div class="box3" @click.stop></div>
            </div>
        </div>
        <div class="box">
            <a href="http://www.baidu.com" @click.prevent="fn1">a链接</a>
        </div>
        <div class="box1 box" @click.capture="fn1">
            <div class="box2" @click.capture="fn2">
                <div class="box3" @click.capture="fn3"></div>
            </div>
        </div>
        
        <div class="box1 box" @click="fn1">
            <div class="box2" @click.self="fn2">
                <div class="box3" @click="fn3"></div>
            </div>
        </div>

        <input type="button" @click.once="fn1" value="按钮">

        <input type="text" @keydown.enter="fn4">

        <div class="box" @mousedown.right="fn4"></div>
        
        <input type="text" @keydown.ctrl.enter="fn4">
    </div>
</body>
<script src="../vue.global.js"></script>
<script>
    Vue.createApp({
        methods:{
            fn1(){
                console.log(1)
            },
            fn2(){
                console.log(2)
            },
            fn3(){
                console.log(3)
            },
            fn4(){
                console.log(4)
            }
        }
    }).mount(".app");
</script>
</html>